/*     */ package com.openbravo.pos.forms;
/*     */ 
/*     */ import com.openbravo.pos.config.JFrmConfig;
/*     */ import com.openbravo.pos.instance.AppMessage;
/*     */ import com.openbravo.pos.instance.InstanceManager;
/*     */ import java.awt.EventQueue;
/*     */ import java.awt.event.WindowAdapter;
/*     */ import java.awt.event.WindowEvent;
/*     */ import java.io.IOException;
/*     */ import java.rmi.RemoteException;
/*     */ import javax.imageio.ImageIO;
/*     */ import javax.swing.JFrame;
/*     */ 
/*     */ public class JRootFrame extends JFrame
/*     */   implements AppMessage
/*     */ {
/*  38 */   private InstanceManager m_instmanager = null;
/*     */   public JRootApp m_rootapp;
public static JRootApp m_rootapp4ati;
/*     */   private AppProperties m_props;
/*     */ 
/*     */   public JRootFrame()
/*     */   {
/*  46 */     initComponents();
/*     */   }
/*     */ 
/*     */   public void initFrame(AppProperties props)
/*     */   {
/*  51 */     this.m_props = props;
/*     */ 
//JRootApp  shg jpanel
/*  53 */     this.m_rootapp = new JRootApp();
/*     */ m_rootapp4ati= this.m_rootapp;
/*  55 */     if (this.m_rootapp.initApp(this.m_props))
/*     */     {
/*  58 */       if ("true".equals(props.getProperty("machine.uniqueinstance"))) {
/*     */         try
/*     */         {
/*  61 */           this.m_instmanager = new InstanceManager(this);
/*     */         }
/*     */         catch (Exception e)
/*     */         {
/*     */         }
/*     */       }
/*  67 */       add(this.m_rootapp, "Center");
/*     */       try
/*     */       {
/*  70 */         setIconImage(ImageIO.read(JRootFrame.class.getResourceAsStream("/com/openbravo/images/favicon.png")));
/*     */       } catch (IOException e) {
/*     */       }
/*  73 */       setTitle("ATIPOS - 1.0.2");
/*  74 */       pack();
/*  75 */       setLocationRelativeTo(null);
/*     */ 
/*  77 */       setVisible(true);
/*     */     } else {
/*  79 */       new JFrmConfig(props).setVisible(true);
/*     */     }
/*     */   }
/*     */ 
/*     */   public void restoreWindow() throws RemoteException {
/*  84 */     EventQueue.invokeLater(new Runnable() {
/*     */       public void run() {
/*  86 */         if (JRootFrame.this.getExtendedState() == 1) {
/*  87 */           JRootFrame.this.setExtendedState(0);
/*     */         }
/*  89 */         JRootFrame.this.requestFocus();
/*     */       }
/*     */     });
/*     */   }
/*     */ 
/*     */   private void initComponents()
/*     */   {
/* 102 */     setDefaultCloseOperation(0);
/* 103 */     addWindowListener(new WindowAdapter() {
/*     */       public void windowClosed(WindowEvent evt) {
/* 105 */         JRootFrame.this.formWindowClosed(evt);
/*     */       }
/*     */       public void windowClosing(WindowEvent evt) {
/* 108 */         JRootFrame.this.formWindowClosing(evt);
/*     */       }
/*     */     });
/*     */   }
/*     */ 
/*     */   private void formWindowClosing(WindowEvent evt) {
/* 115 */     this.m_rootapp.tryToClose();
/*     */   }
/*     */ 
/*     */   private void formWindowClosed(WindowEvent evt)
/*     */   {
/* 121 */     System.exit(0);
/*     */   }
/*     */ }

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.forms.JRootFrame
 * JD-Core Version:    0.6.0
 */